<?php
if(!defined('IN_ORA')) {
	exit('Access Denied');
}
session_start();
$GLOBALS['__page_cache__'] = true;
$act = $GLOBALS['act'] ==""?"index":$GLOBALS['act'];
$GLOBALS['tpl']->assign('act',$act);
if($act == "v"){
	$id = $GLOBALS['_param']['id'];
	if(!$GLOBALS['tpl']->isCached("page-v-id_$id")){
		/** 站点信息 **/
		$GLOBALS['tpl']->assign('sinfo',$GLOBALS['db']->getOne('select * from '.tn('info').' order by Id asc limit 1'));
		
		/** 导航信息 **/
		$GLOBALS['tpl']->assign('navs',$GLOBALS['db']->getAll('select * from '.tn('nav').' order by nav_sort asc limit 6'));
		
		/** 产品分类 **/
		import("lib.cat");
		$GLOBALS['tpl']->assign('cates',cat_lib::getSubChild(0,2,' and cat_type=1'));
		
		$sql = "select ops.*,op.content from ".tn('pages')." ops left join ".tn('page')." op on op.pid = ops.Id where ops.Id=$id";
		$info = $GLOBALS['db']->getOne($sql);
		if(!$info){
			redirect("index-index|true");
		}
		$GLOBALS['tpl']->assign('info',$info);
		/** 当前位置 **/
		$local = array();
		$local[] = array('url'=>parse_uri('page-v-id-%d',$info['Id']),'text'=>$info['name']);
		$GLOBALS['tpl']->assign('local',$local);
	}
	$GLOBALS['tpl']->display("page.html");
}
?>